<template>
   <div class="wraper">
      <swiper :options="swiperOption" v-if="showSwiper">
        <!-- slides -->
        <swiper-slide v-for="item of swiperList" :key="item.id">
        <img class="swiper-img" :src="item.imgUrl" loaded="1" style="opacity: 1;">
        </swiper-slide>
        <!-- Optional controls -->
        <div class="swiper-pagination"  slot="pagination"></div>

      </swiper>
  </div>
</template>

<script>
export default {
  name:"HomeSwiper",
  props:{
    swiperList:Array
  },
  data (){
    return {
      swiperOption:{
        pagination:".swiper-pagination",
        loop:true,
        autoplay:false
      }
      // swiperList:[
      //   {
      //    id:"001",
      //    imgUrl:"//m.360buyimg.com/mobilecms/jfs/t27046/214/347724319/76229/611920b4/5b8f5ba3N86948a71.jpg!cr_1125x549_0_72"
      //   },
      //   {
      //    id:"001",
      //    imgUrl:"//m.360buyimg.com/mobilecms/s1125x690_jfs/t1/3023/25/629/178920/5b922bebEd43bbf7e/b2b3e02698602651.jpg!cr_1125x549_0_72!q70.jpg.dpg"
      //   },
      //   {
      //    id:"001",
      //    imgUrl:"//m.360buyimg.com/mobilecms/s1125x690_jfs/t1/3821/15/671/382746/5b9230ffEc17046aa/1661ff192d00787c.jpg!cr_1125x549_0_72!q70.jpg.dpg"
      //   }
      // ]

    }
  },
  computed:{
    showSwiper () {
      return this.swiperList.length
    }
  }
}
</script>


<style lang="stylus" scoped>
.wraper >>> .swiper-pagination-bullet-active
   background :#fff
.wraper
   overflow : hidden
   width:100%
   height:0
   padding-bottom : 31.25%

 .swiper-img
  width :100%



</style>
